<template>
  <div class="org-activity-list">
    <div class="mian_content">
      <ws-table-el ref="table" v-bind="tableConfig">
        <template #search>
          <search-group>
            <label for>投诉人昵称：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入投诉人昵称" clearable></el-input>
          </search-group>
          <search-group>
            <label for>投诉人ID：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入投诉人ID"></el-input>
          </search-group>
          <search-group>
            <label for>创建人昵称：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入创建人昵称"></el-input>
          </search-group>
          <search-group>
            <label for>创建人ID：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入创建人ID"></el-input>
          </search-group>
          <search-group>
            <label for>工单ID：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入工单ID"></el-input>
          </search-group>
          <search-group>
            <label for>关联订单ID：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入关联订单ID"></el-input>
          </search-group>
          <search-group>
            <label for>投诉人手机号：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入投诉人手机号"></el-input>
          </search-group>
          <search-group>
            <label for>创建时间：</label>
            <el-input v-model.trim="searchOptions.nameOrPhone" placeholder="请输入投诉人手机号"></el-input>
          </search-group>
        </template>
        <template #searchBtns>
          <el-button-group>
            <ws-enter-event>
              <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
            </ws-enter-event>
            <ws-throttle>
              <el-button
                type="primary"
                class="table-column-header-button"
                @click="reset"
                icon="el-icon-refresh-left"
              ></el-button>
            </ws-throttle>
          </el-button-group>
        </template>
        <template>
          <ws-table-column-el prop="driverId" label="工单ID"></ws-table-column-el>
          <ws-table-column-el prop="orgName" label="投诉人昵称"></ws-table-column-el>
          <ws-table-column-el prop="orderScore" label="投诉人ID"></ws-table-column-el>
          <ws-table-column-el prop="driverAdjust" label="投诉人手机号"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="创建人昵称"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="创建人ID"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="工单主题"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="工单模块"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="关联订单ID"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="工单状态"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="创建时间"></ws-table-column-el>
          <ws-table-column-el prop="totalScore" label="操作"></ws-table-column-el>
        </template>
      </ws-table-el>
    </div>
  </div>
</template>

<script>
export default {
  name: 'orderManagement',
  data() {
    return {
      searchOptions: {
        nameOrPhone: ''
      },
      moduleName: '/performance/driverAccount/taxiDriver/list',
      tableConfig: {
        pageId: 'id',
        loading: true,
        filterColumns: false,
        lazyQuery: {
          moduleName: '/performance/driverAccount/taxiDriver/list',
          op: {
            selectList: 'select',
            selectCount: 'count'
          },
          beforeQuery: this.beforeQuery
        }
      }
    }
  },
  methods: {
    beforeQuery() {
      if (this.powerList['sumTotalScore']) {
        this.getTotalScore()
      }
      return { ...this.searchOptions }
    },
    search() {
      console.log(3333)
      // this.$nextTick(() => this.$refs.table.search())
    },
    reset() {
      this.$refs.table.reset()
    },

    getTotalScore(type) {
      let param = {
        data: {
          type: 1
        },
        op: 'sumTotalScore'
      }
      let url = this.$getModuleUrl(this.moduleName, param.op)
      url && this.$axios(url, param).then((res) => (this.totalScore = JSON.parse(res.data)))
    }
  }
}
</script>

<style lang="scss" scoped></style>
